package org.filecollector.filecontroller.virtualcatalogue.virtualfile;

import lombok.NonNull;

import java.io.InputStream;
import java.util.OptionalLong;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * Record contains outer dependencies for {@link VirtualFileClass} and provides all side effects
 * @param debugger Log consumer that sends messages to Debug stream
 * @param warner Log consumer that sends messages to Warn stream
 * @param inform Log consumer that sends messages to Info stream
 * @param errors Log consumer that sends messages to Error stream
 * @param checkSumCounter Function that get InputStream and return Long checkSum
 */
public record VirtualFileDependencies(@NonNull Consumer<String> debugger, @NonNull Consumer<String> warner,
                                      @NonNull Consumer<String> inform, @NonNull Consumer<String> errors,
                                      @NonNull Function<InputStream, OptionalLong> checkSumCounter) {
    public static VirtualFileDependencies getTest() {
        return new VirtualFileDependencies(
                (String _) -> {},
                (String _) -> {},
                (String _) -> {},
                (String _) -> {},
                (InputStream _) -> OptionalLong.of(0L)
        );
    }
}
